<div class="album wp-20" ui-view="container">
    <div ng-if="!noPermission">
        <div class="head_title">
            <span class="tit-color">播控管理</span>
        </div>
        <div class="searchWapper white-background">
            <div class="form-group searchLump search-condition">
                <div class="searchTitle">搜索：</div>
                <div class="search-select">
                    <select ng-model="search.key"
                            ng-options="fileName.key  as fileName.value for fileName in fileNames"></select>
                    <input type="text" class="input width-150" ng-model="search.value"   ui-event="{ keyup : 'keyup($event,search.value)' }">
                    <input type="button" class="btn btn-primary" style="margin-top: -3px" value="搜索" ng-click="findData()">
                </div>
            </div>

            <div class="form-group searchLump">
                <div class="searchTitle">筛选：</div>
                <div class="search-select">
                    <select ng-model="search.playPlan"
                            ng-options="plan.id  as plan.name for plan in planList" ng-change="channelChange()">
                    </select>
                    <select ng-model="search.categoryId"
                            ng-options="category.categoryId  as category.categoryName for category in categories"
                            ng-change="categoryChange(search.categoryId)"></select>
                    <select ng-model="search.channelId"
                            ng-options="channel.channelId  as channel.channelName for channel in channels"
                            ng-change="channelChange()"></select>

                </div>

            </div>
            <div class="form-group searchLump">
                <div class="searchTitle">操作：</div>
                <div class="search-select">
                    <button class="btn btn-primary" style="margin-left: 20px" ng-click="adjustAlbumPlan()">播控调整</button>
                    <button class="btn btn-primary" style="margin-left: 20px" ng-click="adjustPlayOnAndOff()">定时上下线</button>
                </div>

            </div>
        </div>

        <div class="white-background" style="margin:15px  0">

            <table class="table table-bordered table-hover table-page">

                <thead>
                <tr>
                    <th><input type="checkbox" id="allCheck" class="magic-checkbox" ng-model="$parent.allChecked"
                               ng-change="allCheckChange(allChecked)">
                        <label for="allCheck"></label></th>
                    <th>专辑_ID</th>
                    <th>专辑名称</th>
                    <th>节目数</th>
                    <th>总时长</th>
                    <th>一级频道</th>
                    <th>二级频道</th>
                    <th>用户名</th>
                    <th>上线时间</th>
                    <th>下线时间</th>
                    <th>播控方案</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="album in albums">

                    <td>
                        <input type="checkbox" id="{{$index}}" class="magic-checkbox" ng-model="album.checked"
                               ng-change="albumCheckChange(album)" ng-disabled="album.playPlan==0">
                        <label for="{{$index}}"></label>
                    </td>
                    <td>
                        {{album.albumId}}
                    </td>
                    <td>
                        {{album.albumName}}
                    </td>
                    <td>
                        {{album.programNums}}
                    </td>
                    <td>
                        {{album.duration}}
                    </td>
                    <td>
                        {{album.categoryName}}
                    </td>
                    <td>
                        {{album.channelName}}
                    </td>
                    <td>
                        {{album.cpName}}
                    </td>
                    <td>
                        {{album.onlineTime}}
                    </td>

                    <td>
                        {{album.offlineTime}}
                    </td>
                    <td>
                        {{album.playPlan==0?"待上线":album.playPlanName}}
                    </td>

                    <td>
                        <a class="time-out" ng-click="adjustAlbumPlanOne(album.albumId)">播控调整</a>
                        <a class="time-out not-circle" ng-if="album.playPlan==0">定时上下线</a>
                        <a class="time-out" ng-click="adjustAlbumOnAndOff(album.albumId)" ng-if="album.playPlan!=0">定时上下线</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div class="panel-footer paging">
            <s-pagination conf="paginationConf"></s-pagination>
        </div>

    </div>

    <div ng-if="noPermission" ng-include="'templates/no-permission.html'">

    </div>
    <script type="text/ng-template" id="adjustPlayControl.html">

        <div class="modal-header bg-white">
            <button type="button" class="close" ng-click="modelCancel()"><span>&times;</span></button>
            <span class="modal-title">播控管理</span>
        </div>
        <form class="w5c-form demo-form"  w5c-form-validate name="oneLevel">
        <div class="modal-body ng-cloak unDownTime">
            <div class="form-group">
                <label class="col-sm-3 control-label" style="padding: 5px">上线时间：</label>
                <div class="col-sm-7 ">
                    <div class="input-group">
                        <input type="text" class="form-control" uib-datepicker-popup ng-model="data.onlineTime"
                               current-text="今天" clear-text="清除" is-open="popup1.opened" ng-required="true" close-text="关闭" datepicker-options="optStart"
                                name="upTime" required/>
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" style="padding: 4px 12px"
                                    ng-click="popup1Open()"><i
                                    class="glyphicon glyphicon-calendar"></i></button>
                              <button type="button" class="btn btn-default"
                                      ng-click="nowBtnClick()" style="padding: 4px 12px">即时</button>
                         </span>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" style="padding: 5px">下线时间：</label>
                    <div class="col-sm-7 personal-head">
                        <div class="input-group">
                            <input type="text" class="form-control" uib-datepicker-popup ng-model="data.offlineTime"
                                   current-text="今天" clear-text="清除" is-open="popup2.opened" ng-required="true" close-text="关闭" datepicker-options="optStart2"
                                   name="downTime" required/>
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="popup2Open()"
                                    style="padding: 4px 12px"><i
                                    class="glyphicon glyphicon-calendar"></i></button>
                            <button type="button" class="btn btn-default" ng-click="endDateClick()"
                                    style="padding: 4px 12px">不限</button>
                         </span>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" type="button" w5c-form-submit="modelOk()">确定</button>
                <button class="btn ims-btn" type="button" ng-click="modelCancel()">取消</button>
            </div>
        </div>

</form>



    </script>
    <script type="text/ng-template" id="adjustAlbumPlan.html">

        <div class="modal-header bg-white">
            <button type="button" class="close" ng-click="modelCancel()"><span>&times;</span></button>
            <span class="modal-title">方案调整</span>
        </div>
        <form class="w5c-form demo-form"  w5c-form-validate name="plan">
        <div class="modal-body ng-cloak">
            <div class="form-group">
                <label class="col-sm-2 control-label" style="padding: 5px"><i class="red-icon">*</i>方案：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <select ng-model="data.newPlan" name="reason" required>
                            <option value="">播控方案</option>
                            <option ng-repeat="plan in planList" value="{{plan.id}}">{{plan.name}}</option>
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" style="padding: 5px"><i class="red-icon">*</i>原因：</label>
                <div class="col-sm-8 personal-head new-error">
                    <textarea ng-model="data.explain" ng-if="data.newPlan!=0" w5c-dynamic-element
                              name="explain" required="" ng-maxlength="200"></textarea>
                    <textarea ng-model="data.explain" ng-if="data.newPlan==0" w5c-dynamic-element
                              name="explain" required="" ng-maxlength="200"></textarea>
                </div>
            </div>

            <div class="clear"></div>

            <div class="modal-footer">
                <button class="btn btn-primary" type="button" w5c-form-submit="modelOk()">确定</button>
                <button class="btn ims-btn" type="button" ng-click="modelCancel()">取消</button>
            </div>
        </div>
        </form>

    </script>
    <!--<a ui-sref="campaigns.detail({campaignsId:1})"  ui-sref-opts="{inherit:false}">aaaaa</a>-->
</div>
